import {
	request
} from "@/util/request.js";
import {
	obj2Url,
	addAccessToken
} from "@/util";

export function authorizeByPwd(paramsObj, data) {
	const params = obj2Url(paramsObj);
	return request("post", "/v2/SSO/AuthorizeByPwd.aspx?" + params, data);
}

export function accessToken(paramsObj) {
	const params = obj2Url(paramsObj);
	return request("post", "/v2/SSO/AccessToken.aspx?" + params);
}

export function fetchUserInfo(paramsObj) {
	const params = obj2Url(addAccessToken(paramsObj));
	return request("get", "/v2/SSO/UserInfo.aspx?" + params);
}

export function fetchLoginState(paramsObj) {
	const params = obj2Url(addAccessToken(paramsObj));
	return request("get", "/v2/SSO/LoginState.aspx?" + params);
}

export function fetchCompanyList(paramsObj) {
	const params = obj2Url(addAccessToken(paramsObj));
	return request("get", "/v2/SSO/LoginCompanyList.aspx?" + params);
}

export function loginCompany(paramsObj) {
	const params = obj2Url(addAccessToken(paramsObj));
	return request("get", "/v2/SSO/LoginCompany.aspx?" + params);
}

export function loginOut(paramsObj) {
	const params = obj2Url(addAccessToken(paramsObj));
	return request("get", "/v2/SSO/LoginOut.aspx?" + params);
}

export function regByValidCode(paramsObj) {
	const params = obj2Url(paramsObj);
	return request("get", "/v2/SSO/RegByValidCode.aspx?" + params);
}

export function resetPasswordByMobile(paramsObj) {
	const params = obj2Url(paramsObj);
	return request("get", "/v2/SSO/ResetPasswordByMobile.aspx?" + params);
}

export function changePwd(paramsObj) {
	const params = obj2Url(addAccessToken(paramsObj));
	return request("get", "/v2/My/MyInfo/ChangePwd.aspx?" + params);
}

export function changeDispName(paramsObj) {
	const params = obj2Url(addAccessToken(paramsObj));
	return request("get", "/v2/My/MyInfo/ChangeDispName.aspx?" + params);
}

export function changeLogo(paramsObj) {
	const params = obj2Url(addAccessToken(paramsObj));
	return request("get", "/v2/My/MyInfo/ChangeLogo.aspx?" + params);
}

export function msgCatgList(paramsObj) {
	const params = obj2Url(addAccessToken(paramsObj));
	return request("post", "/v2/AppMessage/CatgList.aspx?" + params);
}

export function msgList(paramsObj) {
	const params = obj2Url(addAccessToken(paramsObj));
	return request("post", "/v2/AppMessage/AppMessageList.aspx?" + params);
}

export function fetchFeelbackList(paramsObj) {
	const params = obj2Url(addAccessToken(paramsObj));
	return request("get", "/v2/My/Feelback/FeelbackList.aspx?" + params);
}

export function delFeelback(paramsObj) {
	const params = obj2Url(addAccessToken(paramsObj));
	return request("get", "/v2/My/Feelback/FeelbackDelete.aspx?" + params);
}

export function addFeelback(paramsObj) {
	const params = obj2Url(addAccessToken(paramsObj));
	return request("get", "/v2/My/Feelback/FeelbackAdd.aspx?" + params);
}

export function fetchAddrList(paramsObj) {
	const params = obj2Url(addAccessToken(paramsObj));
	return request("get", "/v2/My/Addr/AddrList.aspx?" + params);
}

export function delAddr(paramsObj) {
	const params = obj2Url(addAccessToken(paramsObj));
	return request("get", "/v2/My/Addr/AddrDelete.aspx?" + params);
}

export function addAddr(paramsObj) {
	const params = obj2Url(addAccessToken(paramsObj));
	return request("get", "/v2/My/Addr/AddrAdd.aspx?" + params);
}

export function EditAddr(paramsObj) {
	const params = obj2Url(addAccessToken(paramsObj));
	return request("get", "/v2/My/Addr/AddrEdit.aspx?" + params);
}

export function defaultAddr(paramsObj) {
	const params = obj2Url(addAccessToken(paramsObj));
	return request("get", "/v2/My/Addr/AddrDefault.aspx?" + params);
}

export function viewAddr(paramsObj) {
	const params = obj2Url(addAccessToken(paramsObj));
	return request("get", "/v2/My/Addr/AddrView.aspx?" + params);
}